<template>
	<div class="alphabet" ref="area_scroll" v-if="CityInfo">
		<div class="scroll_wrap">
			
				<div class="hot_wrap">
					<div class="title">热门城市</div>
					<ul class="hot_city">
						<li  v-for="city,index in CityInfo" :key="index" @click="hotCityName(city)">{{city.name}}</li>
					</ul>
				</div>
				<!-- 所有城市 -->
				<div class="city_wrap">
						
						<ul class="city_content">
							<li v-for="city,index in CityInfo" :key="index"  @click="hotCityName(city)">{{city.name}}</li>
						</ul>
					
				</div>
			
			
		</div>
	</div>
</template>

<script>
	
	export default{
		data(){
			return{
			scroll:null	
			}
		},
		props:{
			CityInfo:Array,
			keys:Array
		},
		methods:{
			// initScroll(){
			// 	this.scroll=new BScroll(this.$refs.area_scroll,{
			// 		click:true
			// 	})
			// }
			hotCityName(city){
				this.$emit('CitySelect',city)
				this.$router.push({name:'address',params:{city:city.name}})
			}
		}
	}
</script>

<style>
.area {
  margin-top: 10px;
  box-sizing: border-box;
  padding: 0 16px;
  background: #fff;
  height: calc(100% - 65px);
  overflow: hidden;
}
.scroll_wrap {
	
  background: #fff;
  overflow: hidden;
}
.title {
	background-color: #FFFFFF;
  color: #aaa;
  padding: 15px 0 15px 20px;
}
.hot_city {
  background-color: #FFFFFF;
  padding: 0 16px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
	
}
.hot_city li {
  width: 30%;
  background: #f1f1f1;
  margin: 0 10px 10px 0;
  text-align: center;
  padding: 10px;
  box-sizing: border-box;
}
.city_content li {
	background-color: #FFFFFF;
  padding: 10px;
  border-bottom: 1px solid #eee;
}
.area_keys {
  position: fixed;
  right: 0;
  top: 25%;
  color: #aaa;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  padding: 0 5px;
}

</style>